<template>
  <div :class="styleClass">
    <Avatar v-if="moduleName=='Avatar'" :avtarProps="moduleProps" :moduleId="id"></Avatar>
    <BasicInfo v-if="moduleName=='BasicInfo'" :basicInfoProps="moduleProps" :moduleId="id"></BasicInfo>
    <BasicInfoLeft v-if="moduleName=='BasicInfoLeft'" :basicInfoLeftProps="moduleProps" :moduleId="id"></BasicInfoLeft>
    <WorkExperience v-if="moduleName=='WorkExperience'" :workProps="moduleProps" :moduleId="id"></WorkExperience>
    <Awards v-if="moduleName=='Awards'" :awardsProps="moduleProps" :moduleId="id"></Awards>
    <EduExperience v-if="moduleName=='EduExperience'" :eduProps="moduleProps" :moduleId="id"></EduExperience>
    <JobIntension v-if="moduleName=='JobIntension'" :jobIntensionProps="moduleProps" :moduleId="id"></JobIntension>
    <Skill v-if="moduleName=='Skill'" :skillProps="moduleProps" :moduleId="id"></Skill>
    <ProjectExperience v-if="moduleName=='ProjectExperience'" :projectProps="moduleProps" :moduleId="id"></ProjectExperience>
    <BlankTemplate v-if="moduleName=='BlankTemplate'" :blankTemProps="moduleProps" :moduleId="id" :layoutType="layoutType"></BlankTemplate>
    <SelfAssessment
      v-if="moduleName=='SelfAssessment'"
      :layoutType="layoutType"
      :selfAssessmentProps="moduleProps"
      :moduleId="id"
    ></SelfAssessment>
  </div>
</template>
<script>
// 引入所有的组件
// 工作经历
import WorkExperience from "@/components/Modules/WorkExperience.vue";
// 荣誉奖励
import Awards from "@/components/Modules/Awards.vue";
// 教育经历
import EduExperience from "@/components/Modules/EduExperience.vue";
// 求职意向
import JobIntension from "@/components/Modules/JobIntension.vue";
// 专业技能
import Skill from "@/components/Modules/Skill.vue";
// 项目经历
import ProjectExperience from "@/components/Modules/ProjectExperience.vue";
// 基础信息（两栏）
import BasicInfo from "@/components/Modules/BasicInfo.vue";
// 基础信息（单栏）
import BasicInfoLeft from "@/components/Modules/BasicInfoLeft.vue";
// 空白模板
import BlankTemplate from "@/components/Modules/BlankTemplate.vue";
// 自我评价
import SelfAssessment from "@/components/Modules/SelfAssessment.vue";
// 照片
import Avatar from "@/components/Modules/Avatar.vue";
export default {
  name: "DragItem",
  props: {
    moduleName: {
      type: String,
      default: "BlankTemplate"
    },
    titleType: {
      type: String,
      default: "title-01"
    },
    // 拖拽区域：'content'：简历编辑区
    dragType: {
      type: String,
      default: "content"
    },
    layoutType: {
      type: String,
      default: ""
    },
    moduleProps: {
      type: Object
    },
    id:{
      type: String,
      require:true,
    }
  },
  computed: {
    styleClass() {
      return this.dragType === "content"
        ? "drag-item-content"
        : "drag-item-left ";
    }
  },
  components: {
    BasicInfo,
    WorkExperience,
    Awards,
    EduExperience,
    JobIntension,
    Skill,
    ProjectExperience,
    BlankTemplate,
    BasicInfoLeft,
    SelfAssessment,
    Avatar
  }
};
</script>
<style lang="less" scoped>
.drag-item-left {
  transform: scale(0.8);
  margin: 5px 0 5px 0;
  border: 1px solid #fff;
  padding: 3px;
}
.drag-item-content {
  width: 100%;
}
</style>

